import { Define, EntityObjectFactory } from 'tiny-entity2';
import { OrganizationTree } from './organizationTree';
import { User } from './user';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "department" })
export class Department extends EntityObjectType<Department>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    organizationId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    description: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.BOOL
    })
    isDelete: boolean;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    depType: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    leaderPerson: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;
    
    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    modifyTime: number;

    orgTree: OrganizationTree;
    leaderObj: User;
}